package While循环;

import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
       int a=1;
        int pos=0;
        int neg=0;
        while (a != 0) {
            System.out.println("请输入一个数");
            a = sc.nextInt();
            if(a>0){
                pos++;
            }else if(a<0){
                neg++;
            }

        }
        System.out.println("输入正数次数为："+pos);
        System.out.println("输入负数次数为："+neg);
    }
}
